Closed-loop controller